\setuppagenumbering[state=stop]
\enableregime[utf]
\setuppapersize[S6][S6]
\setupbodyfont
   [ss,16pt]

\starttext
\usemodule[chart]
\setupFLOWcharts
  [nx=10,
   ny=5,
   dx=2\bodyfontsize,
   dy=1.2\bodyfontsize,
   width=7\bodyfontsize,
   height=7\bodyfontsize,
   maxwidth=0.9\textwidth]
 \setupbodyfont
   [ss,16pt]


\startFLOWchart[FC]
\startFLOWcell
	\name		{start}
%	\location	{4,1}
	\location	{2,3}
	\shape		{procedure}
	\text		{ \setupbodyfont  [ss,4pt]Start}
	\connect 	[rl]{minTime}
\stopFLOWcell
%\startFLOWcell
%	\name		{format}
%	\location	{3,2}
%	\shape		{decision}
%	\text		{Platný formát dat?}
%	\connect	[rl]{format-konec}
%	\comment	[l]{NE}
%	\connect	[bt]{minTime}
%	\comment	[l]{ANO}
%\stopFLOWcell
%\startFLOWcell
%	\name		{format-konec}
%	\location	{4,2}
%	\shape		{procedure}
%	\text		{Konec, bez výsledku.}
%\%stopFLOWcell

\startFLOWcell
	\name		{minTime}
	\location	{3,3}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]Počítej min. čas řešení (minTime)}
	\connect	[rl]{init}
\stopFLOWcell

\startFLOWcell
	\name		{init}
	\location	{4,3}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]Vytvoř úlohy a precedence}
	\connect	[rl]{SS}
\stopFLOWcell	
\startFLOWcell
	\name		{SS}
	\location	{5,3}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]Nová instance {\tt ShopSolver}u}
	\connect	[rl]{ALG}
\stopFLOWcell

\startFLOWcell
	\name 		{ALG}
	\location	{6,3}
	\shape		{decision}
	\text		{ \setupbodyfont  [ss,4pt]Algoritmus}
	\connect	[tl]{DFS}
	\comment	[l]{ \setupbodyfont  [ss,4pt]DFS}
	\connect	[rl]{LDS}
	\comment	[t]{ \setupbodyfont  [ss,4pt]LDS}
	\connect	[bl]{BAB}
	\comment	[l]{ \setupbodyfont  [ss,4pt]BAB}
\stopFLOWcell

\startFLOWcell
	\name		{DFS}
	\location	{7,2}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]DFS search}
	\connect	[rl]{limit}
\stopFLOWcell

\startFLOWcell
	\name		{LDS}
	\location	{7,3}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]LDS search}
	\connect	[rl]{limit}
\stopFLOWcell

\startFLOWcell
	\name		{BAB}
	\location	{7,4}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]BAB search}
	\connect	[rl]{limit}
\stopFLOWcell

\startFLOWcell	
	\name		{limit}
	\location	{8,3}
	\shape		{decision}
	\text		{ \setupbodyfont  [ss,4pt]Překročen čas. limit ?}
	\connect	[br]{increase}
	\comment	[r]{ \setupbodyfont  [ss,4pt]ANO}
	\connect	[rl]{found}
	\comment	[t]{ \setupbodyfont  [ss,4pt]NE}
\stopFLOWcell


\startFLOWcell
	\name		{found}
	\location	{9,3}
	\shape		{decision}
	\text 		{ \setupbodyfont  [ss,4pt]Nalezeno řešení?}
	\connect	[bt]{konec}
	\comment	[l]{ \setupbodyfont  [ss,4pt]ANO}
	\connect	[tr]{minTimePlus}
	\comment	[t]{ \setupbodyfont  [ss,4pt]NE}
\stopFLOWcell
\startFLOWcell
	\name		{konec}
	\location	{9,4}
	\shape		{procedure}
	\text		{ \setupbodyfont  [ss,4pt]Výsledek, Konec}
\stopFLOWcell
\startFLOWcell
	\name		{minTimePlus}
	\location	{6,1}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]minTime +1}
	\connect	[lt]{SS}
\stopFLOWcell


\startFLOWcell
	\name 		{increase}
	\location	{6,5}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]Zvyš limit}
	\connect	[lr]{sort}
\stopFLOWcell

\startFLOWcell
	\name		{sort}
	\location	{5,5}
	\shape		{action}
	\text		{ \setupbodyfont  [ss,4pt]Přerovnej úlohy}
	\connect	[tb]{SS}
\stopFLOWcell		

\stopFLOWchart
\FLOWchart[FC]
\stoptext
